$(function() {
	var options = {lang:'<?php echo $_GET['l'] ?>',styleWithCSS:false,cssfiles:['includes/wysiwyg/css/textarea.css'],allowSource:true,height:250,toolbar:'maxi',fmOpen:function(callback){$('<div id="myelfinder" />').elfinder({url:'includes/wysiwyg/connector.php',lang : '<?php echo $_GET['l'] ?>',dialog:{width:700,modal:true,title:'Dateimanager'},closeOnEditorCallback:true,editorCallback:callback});}
	}
	$('#tabs').tabs({fx:{opacity:'toggle'},
		show: function(event, ui){
			var lId = ui.panel.id.substring(9);
			setTimeout(function(){$('#textarea_'+lId).elrte(options);},500);
		},
		select: function(event, ui){
			var lId = ui.panel.id.substring(9);
			setTimeout(function(){$('#textarea_'+lId).elrte(options);},500);
		}
	});
	if($('#textarea_<?php echo $_GET['id'] ?>') && $('#textarea_<?php echo $_GET['id'] ?>').is(':visible'))
		$('#textarea_<?php echo $_GET['id'] ?>').elrte(options);
});